SHELL := /bin/bash

INST_PATH=`pwd`/install
SQL_PATH=../sqlite

CFLAGS+=-I${INST_PATH}/include
LDFLAGS+=-L${INST_PATH}/libs -lmylib -lsqlite3

CC=gcc

all:
	@echo "Start complie library..."
	mkdir -p ${INST_PATH}/{bin,etc,include,libs}
	make -C ${SQL_PATH}
	make -C src		
	@echo "Start complie library..."
#	${CC} ${CFLAGS} server.c -o server ${LDFLAGS} -lpthread -ldl -lm

	#支持gdb调试版本
	${CC} ${CFLAGS} server.c -o server ${LDFLAGS} -lpthread -ldl -lm -g

	make Install

Install:
	mv server ${INST_PATH}/bin

clean:
	make clean -C src

distclean: clean
	rm -r install
